package com.cd.quartz.task;

import com.cd.sendRequest.api.SendService;
import com.cd.song.api.SongService;
import com.cd.system.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Description task test
 * @Author lqq
 * @Date 2024/8/14 14:00
 **/
@Component("testTask")
public class TestTask {

    @Autowired
    UserService userService;

    @Autowired
    SongService songService;

    @Autowired
    SendService sendService;

    private static final Logger log = LoggerFactory.getLogger(TestTask.class);

    public void run() {
        log.info("i am lqq");
    }

    public void run(String name) {
        log.info("{} is lqq", name);
    }

    public void running(String name) {
        log.info("{} is lqq", name);
    }

    //testTask.recordUserCount()
    public void recordUserCount() {
        log.info("开始执行每日用户数量记录");
        userService.recordUserCount();
        log.info("每日用户数量记录完毕");
    }

    public void loadMusicListWithDisk() {
        log.info("开始执行歌曲列表加载");
        songService.loadMusicListWithDisk();
        log.info("歌曲列表加载完毕");
    }

    public void fetCurrentDouyinData() {
        log.info("开始执行抖音粉丝加载");
        sendService.fetCurrentDouyinData();
        log.info("抖音粉丝加载完毕");
    }
}
